package com.code.day22;

public class Person {
    public String sex;
    private  String name;
    private  int age;


    public Person(String name, int  age) {
        this.name = name;
        this.age = age;
    }

    public Person() {
    }
    /**
     * 添加一个私有构造
     * @return
     */
    private  Person(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    private void show(){
        System.out.println("我是私有方法");
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(int  age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }
}
